<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<div th:replace="/common/head :: head"></div>
<body>
<!-- 网站头部 -->
<div class="fly-header layui-bg-black" th:include="/common/header :: header"></div>


<div class="layui-container fly-marginTop">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title">
        <li><a href="/user/login.html">登入</a></li>
        <li class="layui-this" th:text="${pass == 1?'重置密码':'找回密码'}"><!--重置密码--></li>
      </ul>
      <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <!-- 重置密码 -->
          <div th:if="${pass == 1}" th:text="${user.username}+'，请重置您的密码'" class="fly-msg">{{d.username}}，请重置您的密码</div>
          <div th:if="${pass == 1}" class="layui-form layui-form-pane"  style="margin-top: 30px;">
            <form action="/user/forget/repass" method="post">
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">新密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_pass" name="pass" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">6到16个字符</div>
              </div>
              <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">确认密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_repass" name="repass" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_vercode" class="layui-form-label">人类验证</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_vercode" name="vercode" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid">
                    <img class="fly-imagecode" src="/images/captcha"/>
                </div>
              </div>
              <div class="layui-form-item">
                <input type="hidden" name="username" th:value="${user.username}">
                <input type="hidden" name="email" th:value="${user.userEmail}">
                <button class="layui-btn" alert="1" lay-filter="*" lay-submit>修改密码</button>
              </div>
            </form>
          </div>


          <div th:if="${pass == 2}" class="fly-error">该重置密码链接已失效，请重新校验您的信息</div>
          <div th:if="${pass == 3}" class="fly-error">非法链接，请重新校验您的信息</div>

          <div th:if="${pass != 1}" class="layui-form layui-form-pane">
            <form method="post" action="/user/forget/">
                <div class="layui-form-item">
                    <label for="L_email" class="layui-form-label">邮箱</label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_email" name="email"  lay-verify="required|myemail" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_vercode" class="layui-form-label">人类验证</label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_vercode" name="vercode" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid">
                        <img class="fly-imagecode" src="/images/captcha"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <button class="layui-btn" alert="1" lay-filter="*" lay-submit>发送验证码</button>
                </div>
            </form>
        </div>
          
        </div>
      </div>
    </div>
  </div>

  
</div>

<!-- 页尾 -->
<div th:replace="/common/footer :: footer"></div>

</body>
</html>